// 解构
// const arr = [1, 2, 3];
// const [, , a3] = arr;
// console.log(a3);

// const arr = [1, 2, 3];
// const [a1, ...rest] = arr;
// console.log(rest);

const arr = [1, 2, 3];
const a1 = 33;
const [a1, a2 = 22, a3, a4 = 4] = arr;
console.log(a1, a2, a3, a4);

// const obj = { name: "jack", age: 18 };
// const { name } = obj;
// console.log(name);

const obj = { name: "jack", age: 18 };
const name = "bob";
const { name: objName = "tom" } = obj;

console.log(name);
console.log(objName);
